package com.kxmall.common.utils;

import org.springframework.context.ApplicationContext;

public class Const {
	public static final String SESSION_SECURITY_CODE = "sessionSecCode";//验证码
	public static final String SESSION_USER = "sessionUser";			//session用的用户

    public static ApplicationContext WEB_APP_CONTEXT = null; //该值会在web容器启动时由WebAppContextListener初始化

	public static String CONTROL_KEY = "88437049439590280cfb16a048279391";
	public static String APP_KEY = "88437049439590280cfb16a048279391";
	
	public static int MAX_CERTIFICATE_TIMES = 5;	// 单用户最大身份认证错误次数
	
	//普通用户，信用用户
	public static final int USER_CATOGERY_NORMAL = 0;
	public static final int USER_CATOGERY_CREDIT = 1;
	
	//正常用户，黑名单用户
	public static final int USER_STATUS_NORMAL = 0;
	public static final int USER_STATUS_BLACK = 1;
	public static final int USER_STATUS_CANCEL = 2;

	//用户押金状态（0无押金/1正在退押金/2有押金）
	public static final int USER_DEPOSIT_STATUS_NONE = 0;
	public static final int USER_DEPOSIT_STATUS_RETURNING = 1;
	public static final int USER_DEPOSIT_STATUS_VALID = 2;
	
	//用户租还伞状态
	public static final int USER_UMBRELLA_STATUS_INIT = 0;
	public static final int USER_UMBRELLA_STATUS_RENT = 1;
	public static final int USER_UMBRELLA_STATUS_RETURN = 2;
	
	//伞是否存在标志
	public static final int UMBRELLA_EXIST = 0;
	public static final int UMBRELLA_NOEXIST = 1;
	
	//伞状态
	public static final int UMBRELLA_STATUS_STOCKIN = 0;
	public static final int UMBRELLA_STATUS_UPCONTROL = 1;
	public static final int UMBRELLA_STATUS_DOWNCONTROL = 2;
	public static final int UMBRELLA_STATUS_DISCARD = 3;
	public static final int UMBRELLA_STATUS_SELL = 4;
	public static final int UMBRELLA_STATUS_RENT = 5;
	public static final int UMBRELLA_STATUS_RETURN = 6;
	public static final int UMBRELLA_STATUS_RENT_REVERSE = 7;
	
	//租伞，租伞冲正
	public static final int RENT_NORMAL = 0;
	public static final int RENT_REVERSE = 1;
	
	//记录类型
	public static final int RECORD_TYPE_ONLINE = 0;
	public static final int RECORD_TYPE_OFFLINE = 1;
	public static final int RECORD_TYPE_POWEROFF = 2;
	
	//同步类型
	public static final int SYNC_RENT = 0;
	public static final int SYNC_RENT_REVERSE = 1;
	public static final int SYNC_RETURN = 2;
	
	//是否有伞
	public static final int LOCK_HAVE_UMBRELLA_NONE = 0;
	public static final int LOCK_HAVE_UMBRELLA_IS = 1;
	
	// 交易状态 0已还/1已租/3已承包
	public static final int TRADE_STATE_RETURNED = 0;
	public static final int TRADE_STATE_RENDING = 1;
	public static final int TRADE_STATE_BUY = 2;

	// 交易异常状态 0正常/1已买/2异常
	public static final int TRADE_EXP_NORMAL = 0;
	public static final int TRADE_EXP_BUY = 1;
	public static final int TRADE_EXP_OTHER = 2;

	//交易类型 0押金充值/1押金退款/2被动购伞/3租伞超72小时扣押金/6余额充值/7租伞费用/8主动购伞/9租金退款/14代扣租金/16 银联支付10元购买20元优惠券/17商城/18积分抵扣/10人工余额退款
	public static final int TRADE_TYPE_DEPOSIT_IN = 0;
	public static final int TRADE_TYPE_DEPOSIT_OUT = 1;
	public static final int TRADE_TYPE_BE_BUY = 2;
	public static final int TRADE_TYPE_DEPOSIT_FEE = 3;
	public static final int TRADE_TYPE_BALANCE_IN = 6;
	public static final int TRADE_TYPE_BALANCE_DEDUCTION_IN = 13;
	public static final int TRADE_TYPE_FEE = 7;
	public static final int TRADE_TYPE_FEE_COUPON = 12;
	public static final int TRADE_TYPE_BUY = 8;
	public static final int TRADE_TYPE_FEE_REFUND = 9;
	public static final int TRADE_TYPE_COUPON_RECHARGE = 11;
	public static final int TRADE_TYPE_AGREE_PAY_IN = 14;
	public static final int TRADE_TYPE_FEE_AGREE_PAY= 15;
	public static final int TRADE_TYPE_UNIONPAY_COUPON10TO20 = 16;
	public static final int TRADE_TYPE_WXA_MALL = 17;
	public static final int TRADE_TYPE_POINTS_DEDUCTION = 18;
	public static final int TRADE_TYPE_MONTHLY_CARD_RECHARGE = 20;
	public static final int TRADE_TYPE_RENT_FEE_ORDER = 21;
	public static final int TRADE_TYPE_COUPON_DEDUCTION = 22;

	//交易通道(0余额/1微信/2支付宝/3付费通/4押金/5招行一网通/6摩伞/7微信小程序
	// /8银联/9魔伞手动/10屏优多/11摩伞券/12京东支付/13八维通/14建行数币)
	public static final int CHANNEL_BALANCE = 0;
	public static final int CHANNEL_WXPAY = 1;
	public static final int CHANNEL_ALIPAY= 2;
	public static final int CHANNEL_FFTPAY = 3;
	public static final int CHANNEL_DEPOSIT = 4;
	public static final int CHANNEL_CMBPAY = 5;
	public static final int CHANNEL_MOSUN = 6;
	public static final int CHANNEL_WXAPAY = 7;
	public static final int CHANNEL_UNIONPAY = 8;
	public static final int CHANNEL_MOSUN_MANUAL = 9;
	public static final int CHANNEL_PUDPAY = 10;
	public static final int CHANNEL_COUPON = 11;
	public static final int CHANNEL_JDPAY = 12;
	public static final int CHANNEL_BWTON = 13;
	public static final int CHANNEL_CCBPAY = 14;
	public static final int CHANNEL_ABCPAY_SZ = 15;

	public static final int CHANNEL_ABCPAY_NB = 16;

	// 支付状态（0失败/1成功/2未知/3新建/4处理中）
	public static final int ORDER_PAY_STATUS_FAIL = 0;
	public static final int ORDER_PAY_STATUS_SUCCEED = 1;
	public static final int ORDER_PAY_STATUS_UNKNOWN = 2;
	public static final int ORDER_PAY_STATUS_NEW = 3;
	public static final int ORDER_PAY_STATUS_PROCESSING = 4;

	// 审核结果 1受理中/2拒绝/3/退款中/4退款成功/5退款失败/6转账退款中
	public static final int DEPOSIT_RETURN_ACCEPT = 1;
	public static final int DEPOSIT_RETURN_REFUSED = 2;
	public static final int DEPOSIT_RETURN_ING = 3;
	public static final int DEPOSIT_RETURN_SUCCEED = 4;
	public static final int DEPOSIT_RETURN_FAILED = 5;
	public static final int DEPOSIT_RETURN_IN_TRANSFER = 6;
	public static final int TRADE_OVERDUE = 7;
	public static final int DEPOSIT_SUZHOU = 2000;
	public static final int DEPOSIT_NINGBO = 3000;
	// 购买类型（0主动购买/1被动购买）
	public static final int BUY_UMBRELLA_ACTIVE = 0;
	public static final int BUY_UMBRELLA_PASSIVE = 1;
	
	//积分
	public static final int SCORE_REGISTER = 50;
	public static final int SCORE_RENT = 2;
	public static final int SCORE_BUY = 10;
	public static final int SCORE_FAULT = -5;
	
	//返回结果
	public static final String RESP_SUCCESS = "0000";	// 成功
	public static final String RESP_ERROR_DB = "1000";	// 数据库错误
	public static final String RESP_ERROR_BLACKUSER = "1003";	// 黑名单
	public static final String RESP_ERROR_NODEPOSIT = "1004";	// 没有押金
	public static final String RESP_ERROR_VERIFYCODE = "1005";	// 图形验证码错误
	public static final String RESP_ERROR_CERTIFICATE = "1006";	// 身份认证失败
	public static final String RESP_ERROR_CERTOVERTIMES = "1007";	// 身份认证超过次数
	public static final String RESP_ERROR_RETURNDEPOSIT = "1008";	// 押金已退
	public static final String RESP_ERROR_CERTMORETIMES = "1009";	// 身份认证失败3次以上
	public static final String RESP_ERROR_NOUSER = "2001";	// 没有用户
	public static final String RESP_ERROR_NOORDER = "2002";	// 没有订单
	public static final String RESP_ERROR_TIMEOUT = "2003";	// Token超时
	public static final String RESP_ERROR_VERIFY = "2004";	// 验证码错误或没有用户
	public static final String RESP_ERROR_SENDSMS = "2005";	// 短信验证码发送错误
	public static final String RESP_ERROR_NOTERMINAL = "2006";	// 没有终端
	public static final String RESP_ERROR_NOTRADE = "2007";	// 没有交易记录
	public static final String RESP_ERROR_PARAM = "2008"; // 参数错误
	public static final String RESP_ERROR_PASSWORD = "2009";	// 密码错误
	public static final String RESP_ERROR_NOTASK = "2010";	// 没有任务
	public static final String RESP_ERROR_BUSY = "2011";	// 已租伞
	public static final String RESP_ERROR_IDLE = "2012";	// 未租伞
	public static final String RESP_ERROR_NOUSERACCOUNT = "2013";	// 没有用户账户
	public static final String RESP_ERROR_BALANCEISNEGATIVE = "2014";	// 余额为负，请先充余额
	public static final String RESP_ERROR_CREATEORDER = "2015";	// 生成订单失败
	public static final String RESP_ERROR_OVER_QUOTA = "2016";	// 生成订单失败
	public static final String RESP_ERROR_TOKEN = "5000";	// token错误，需要重新登录
	public static final String RESP_ERROR_LOCKNO = "5001";	// 非法锁号
	public static final String  RESP_ERROR_UMNO= "5002";	// 非法伞号
	public static final String  RESP_ERROR_PAY_CHANNEL_NOT_OPENED= "5003";	// 支付通道未开通
	public static final String  RESP_ERROR_MANUAL_REFUND_REDIRECT= "5004";	// 支付通道未开通


	public static final String RESP_ERROR_DEPOSIT_STATUS = "2100";	// 押金状态不符合
	public static final String RESP_ERROR_DEPOSIT = "2101";			// 没有交付押金，无法购伞!
	public static final String RESP_ERROR_RETURN = "2102";			// 该伞已还伞
	public static final String RESP_ERROR_DEPOSIT_RETURN = "2103";	// 没有退押金流水或状态不对
	public static final String RESP_ERROR_DEPOSIT_ALIPAY = "2104"; 	// 支付宝退押金失败
	public static final String RESP_ERROR_DEPOSIT_RETURNING = "2105"; // 押金正在退款中
	public static final String RESP_ERROR_DEPOSIT_HAVING = "2106"; 	// 押金已充值
	public static final String RESP_CODE_KEY = "respcode";
	public static final String RESP_DESC_KEY = "respdesc";

	// 二维码组成： 头（2位） 用户ID（10位）+时间（14位）
	// 二维码头（2位）
	public static final String QRTYPE_USER = "00";		// 用户
	public static final String QRTYPE_LOCK = "10";		// 关锁
	public static final String QRTYPE_UNLOCK = "11";	// 开锁
	public static final String QRTYPE_SIGNIN = "20";	// 签到
	
	// 运维任务状态(0发布/1执行中/2完成/3拒绝)
	public static final int TASK_STATUS_NEW = 0;
	public static final int TASK_STATUS_RUNNING = 1;
	public static final int TASK_STATUS_FINISH = 2;
	public static final int TASK_STATUS_REFUESD = 3;

	// 任务结果(0失败/1成功)
	public static final int TASK_RESULT_FAILED = 0;
	public static final int TASK_RESULT_SUCCEED = 1;

	//京东代扣签约状态
	public static final String JD_WITHHODING_AGREEMENT_TYPE_VALID = "FINI";
	public static final String JD_WITHHODING_AGREEMENT_TYPE_CLOSED = "CLOS";

	public static final String JD_WITHHODING_RESP_CODE = "code";
	public static final String JD_WITHHODING_AGREEMENT_STATUS= "agreementStatus";

	public static final String JD_WITHHODING_RESP_CODE_SUCCESS = "0000";

	public static final String JD_PAY_RESP_CODE = "code";
	public static final String JD_PAY_RESP_DESC = "desc";
	public static final String JD_PAY_TRADE_STATUS = "tradeStatus";

	public static final int PREORDER_FINI = 2;
	public static final int PREORDER_NEW = 0;
	public static final int PREORDER_ARREARS = 1;
	public static final int PREORDER_BUY = 3;

	public static final String WX_SESSION_KEY = "wxkey";

	public static final int USER_SCORE_TYPE_REG = 0;
	public static final int USER_SCORE_TYPE_BUY_UM = 5;
	public static final int USER_SCORE_TYPE_RETURN_POINT = 3;
	public static final int USER_SCORE_RETURN_FRIEND_POINT = 7;
	public static final int USER_SCORE_WITHDRAWAL = 9;
	public static final int USER_SCORE_SHARE = 2;
	public static final int USER_SCORE_SYS_PRESENT = 10;

	public static final String MERCHANT_SESSION_TIMEOUT_KEY = "merchantSessionTimeout";
	public static final int LOGIN_TYPE_NORMAL = 0;
	public static final int LOGIN_TYPE_RELOGIN = 1;

	public static final int COUPON_TYPE_MONTHLY_CARD = 1;
	public static final int COUPON_TYPE_NORMAL = 0;
	public static final int COUPON_TYPE_NEW = 2;

	public static final Byte COMMISSION_ORDER_STATUS_NEW = 0;
	public static final Byte COMMISSION_ORDER_STATUS_PASS = 1;
	public static final Byte COMMISSION_ORDER_STATUS_SUCCESS = 2;
	public static final Byte COMMISSION_ORDER_STATUS_FAIL = 3;

	public static final Byte COMMISSION_ORDER_STATUS_CANCEL = 4;

	public static final String CITY_CODE_SHANGHAI = "0021";
	public static final String CITY_CODE_SUZHOU = "0512";
	public static final String CITY_CODE_NINGBO = "0574";

	public static final String CITY_CODE_QINGDAO = "0532";

	public static final String CITY_CODE_NANCHANG = "0791";

	public static final String TX_CITY_CODE_SUZHOU = "156320500";
	public static final String TX_CITY_CODE_SHANGHAI = "156310000";

	public static final String TX_CITY_CODE_NINGBO = "156330200";

}
